package com.cnplan.controller;

import com.cnplan.core.Constant;
import com.cnplan.entity.SystemUser;
import com.cnplan.service.AuthService;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * Created by Administrator on 2018/5/28.
 */
@Controller(value = "ApiController")
@RequestMapping("/api")
public class ApiController {

    @Autowired
    private AuthService authService;

//    @RequestMapping(value={"/getMapLayers"}, produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
//    @ResponseBody
//    public String getMapLayer(HttpServletRequest request) throws Exception{
//        SystemUser systemUser = (SystemUser) (request.getSession().getAttribute(Constant.CURRENT_USER));
//        List<SystemMapService> mapServiceList = authService.listSystemMapServiceByUserId(systemUser.getId());
//
//        GsonBuilder gsonBuilder = new GsonBuilder();
//        gsonBuilder.serializeSpecialFloatingPointValues();
//        Gson gson = gsonBuilder.create();
//        return gson.toJson(mapServiceList);
//    }
}
